package com.neu.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.neu.entity.User;
import com.neu.service.UserService;
import com.neu.util.JWTUtil;
import com.neu.util.JsonResult;
import com.neu.util.ResultCode;



@CrossOrigin
@Controller("userController")
@RequestMapping("/his/user")
public class UserController {

	@Autowired
	private UserService userService;
	
	@ResponseBody
	@RequestMapping(value="/login", method = RequestMethod.POST)
	public JsonResult<User> login(@RequestBody String requestBody)  {
		
		return new JsonResult<User>(ResultCode.SUCCESS,user);
	}
	
	@ResponseBody
	@RequestMapping("/get_user")
	public JsonResult<List<User>> findUser(@RequestParam("pageNum") int page,
			@RequestParam("pageSize") int count,
			@RequestParam("keywords") String keywords,HttpServletRequest request){
		return new JsonResult<List<User>>();
	}
	
	@ResponseBody
	@RequestMapping("/get_user_more")
	public JsonResult<List<User>> getUserList02(
			@Param("page") Integer page, 
		@Param("count") Integer count, 
		@Param("keywords") String keywords, 
		@Param("keywords02") String keywords02,
		@Param("keywords03") String keywords03){
		
		return new JsonResult<List<User>>();
	}
	
	@ResponseBody
	@RequestMapping(value="/add_user",method=RequestMethod.POST)
	public JsonResult<Integer> add(User user){
		
		return new JsonResult<Integer>();
	}
	
	@ResponseBody 
	@RequestMapping("/getcount")
	public JsonResult<Integer> getUserCount(@Param("keywords") String keywords){
		
		return new JsonResult<Integer>();
	}
	
	
	@ResponseBody
	@RequestMapping("/delete_user")
	public JsonResult<Integer> deleteUserById(@Param("id") int id){
		
		return new JsonResult<Integer>();
	}
	
	
	@ResponseBody
	@RequestMapping("/delete_user_more")
	public JsonResult<Integer> deleteUserByIds(@RequestBody Integer[] ids){
		
		return new JsonResult<Integer>();
	}
}
